<?php 
	namespace app\admin\controller;
	use \think\Controller;
	/**
	* 
	*/
	class Base extends Controller
	{
		
		function __construct()
		{
			parent::__construct();
			if(!cookie("name")){
    			$this->error("用户未登录,请等待...","index/login","",1);
    		        }
		}
		// 获取正确分类顺序
		public function getcates($cates,$fid=0){
			static $cates2=array();
			foreach($cates as $v){
				if($v['pc_f_id']==$fid){	
					$cates2[]=$v;
					$this->getcates($cates,$v['id']);
				}
			}
			return $cates2;
		}
		public function msg($message,$url){
     		echo "<script>alert('{$message}');location.href='{$url}'</script>";
    	         }
	}
 ?>
